<?php
// 打开要截取的图片
$bg = imageCreateFromjpeg('./bg.jpg');
// 新建一个画布
$logo = imageCreateFrompng('./logo.png'); 

$bg_w = imagesx($bg);

$bg_h = imagesy($bg);

$w = imagesx($logo);

$h = imagesy($logo);

imagecopymerge ( $bg , $logo ,0  ,$bg_h-$h , 0, 0 ,$w , $h,50);

// 4  保存  输出 
header("Content-type: image/png");

imagepng($bg);